package graphic.primitives.car;

import graphic.primitives.general.GraphicObject;
import graphic.primitives.general.IGraphicObject;

/**
 * Trida pro vykresleni zadni casti auta.
 * 
 * @author David Zbornik
 */
 public class BackPart extends GraphicObject implements IGraphicObject {
	
	/**
	 * Konstruktor.
	 */
	public BackPart()
	{
		super();
	}
	
	/**
	 * Konstruktor.
	 * 
	 * @param int [x]
	 * @param int [y]
	 * @param int [a]
	 * @param int [b]
	 * @param int [c]
	 */
	public BackPart (int x, int y, int a, int b, int c)
	{
		this();
		setXYABC(x, y, a, b, c);
	}
	
	/**
	 * Metoda pro vykresleni objektu.
	 * 
	 * @param void
	 * @return void
	 */
	@Override
	public void redraw(){
		mainWindow.line(x, y, x, y-b );
		mainWindow.line(x,y-b,x+c,y-b);
		mainWindow.line(x,y,x+a,y);
	}
	
	/**
	 * Nastavi souradnice a velikost objektu.
	 * 
	 * @param int [x]
	 * @param int [y]
	 * @param int [a]
	 * @param int [b]
	 * @param int [c]
	 */
	public final void setXYABC(int x, int y, int a, int b, int c)
	{
		this.x = x;
		this.y = y;
		
		this.a = a;
		this.b = b;
		this.c = c;
	}

	private int a;
	private int b;
	private int c;
}
